#probe ID        refseq ID       Gene Symbol     log2 FC values (against preadip)
#ILMN_1735045    NM_017436       A4GALT  "0.040365, -0.15992, 0.063337, 0.25641, 0.44225, 0.89837"

import sys

"""
var ch = {ADCH:[{name:'NM_001003684', data:[0.058872, 0.16703, 0.1189, 0.124, 0.094661, 0.63558]},
{name:'NM_013387', data:[-0.088998, -0.045791, -0.073643, -0.045285, 0.086565, 0.094477]},
{name:'NM_013387', data:[0.070917, 0.16415, 0.27671, 0.11552, 0.26926, 0.2989]}]};

Entrez Gene ID  Recon1 Entrez Gene ID   Gene symbol     Rxns
13      13      AADAC   EGMESTr
15      15      AANAT   SRTNACT
18      18      ABAT    "3AIBTm, ABTArm, APAT2rm"
19      19      ABCA1   "CHSTEROLt, CHSTEROLtg"

"""

gf = open("GenesSimple.txt", "r")
out = open("fatgenes_rxn.js", "w")

ec_dic = {}

for l in gf.readlines():
	ec_arr = []
	tk = l.strip().split("\t")
	gene = tk[2]
	
	tka = tk[3].strip().replace('"','')
	ec_dic[gene] = tka
gf.close()

out.write("var genes_rxn_dic = " + str(ec_dic) + ";\n")

#A4GALT  0.040365, -0.15992, 0.063337, 0.25641, 0.44225, 0.89837
#A4GNT   0.088388, -0.017695, 0.027588, -0.011051, -0.013554, 0.0053847
